# _*_ coding:utf-8 _*_
# @Time : 2023/6/12 14:46
# @Author : wsl
# @File : demo
# @Project : python

import requests

url = 'https://www.baidu.com/s'


headers = {
       'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0',
       'accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
       'referer':'',         #该请求没有来源网页可不填
       'cookie':'BAIDUID=23891A85BA85C16E5C9B5560154BA69C:FG=1; BIDUPSID=B6A72EB557B74FFA3D56BB80DB603C2C; PSTM=1663062807; BD_UPN=13314752; BDORZ=FFFB88E999055A3F8A630C64834BD6D0; BA_HECTOR=alal2001850g8l81252h8aqu1hi0t9e18; ZFY=SEUInM0ZuRBXFZUw1B0dlkNP:BZj3M:BZlpxlcZfdCgw8:C; BD_HOME=1; H_PS_PSSID=36558_37117_37354_37300_36885_34812_36802_36789_37145_37258_26350_37364; delPer=0; BD_CK_SAM=1; PSINO=7; BDRCVFR[Fc9oatPmwxn]=aeXf-1x8UdYcs; BDUSS=Zpc0MwUDE5bTZ4dUdQcUIxM2Z1SnFZMEpvUGpxTlRBWTBaTjZVdlh1V0tDRWxqRVFBQUFBJCQAAAAAAQAAAAEAAACnhFosAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIp7IWOKeyFjUD; H_PS_645EC=18db%2FxuyDIkSXG5WHmpOcEYdpAWQjJ77VSAYXPxhCINzCpt3nIF4SZssA6n9ATbCjzGM; BDSVRTM=247; baikeVisitId=e2c826a7-6934-4751-ac3d-29e118347887'
    }

data = {
    'wd': '北京'
}

response = requests.get(url=url, params=data, headers=headers)
response.encoding='utf-8'
content=response.text
print(content)